<?
/*
 * @name accountList.php
 * @creater Charles Koh
 */
	include '../../server/dbconn.php';
	
   $sql = 'select id,email from member limit 10';
   $result = mysql_query($sql, $connect);

   $num_match = mysql_num_rows($result);

	if($num_match) 
    {
		echo "<script> window.onload = function () { var list = document.getElementById('account_list'), li = null;";
        while($row = mysql_fetch_array($result)) {
        	echo "li = document.createElement('li');
        		li.innerHTML = \"{$row[id]} : {$row[email]}\";
        		list.appendChild(li);";
		}
		echo "};</script>";
 	}
?>
<html>
<head>
</head>

<body>
	<div style="border: 1px solid #777;height:100%;">
		Real-Time Account list
		<ul id="account_list">
			
		</ul>
	</div>
</body>
</html>